<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <include file="Public:jquery" />
        <include file="Public:dialog" />
        <include file="Public:startapp" />
        <include file="Public:startmoo" />
        <script type="text/javascript">
            $(function(){
                
                $('.edit_links').click(function(){
                    var $this = $(this);
                    var edit_links = art.dialog({
                        title : '编辑',
                        lock : true
                    });
                    
                    $.ajax({
                        url : $this.attr('href'),
                        success : function (e){
                            edit_links.content(e);
                            submitstyle();
                        },
                        cache : false
                    });
                    return false;
                });
                
                $('#add_links').click(function(){
                    var $t = $(this);
                    var add_links = art.dialog({
                        title : $t.text(),
                        lock : true
                    });
                    $.ajax({
                        url : '{:U("add")}',
                        success : function (e){
                            add_links.content(e);
                            submitstyle();
                        },
                        cache : false
                    });
                });
                
                $('#add_links_type').click(function(){
                    var $t = $(this);
                    var add_links_type = art.dialog({
                        title : $t.text(),
                        lock : true
                    });
                    $.ajax({
                        url : "{:U('addtype')}",
                        success : function (e){
                            add_links_type.content(e);
                            submitstyle();
                        },
                        cache : false
                    });
                });
            });
            
        </script>
    </head>
    <body>
        <include file="Public:header" />
        
        <div class="layout">
            
            <include file="Public:position" />
            
            <table class="warp" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="sidebar" valign="top">
                        <include file="Public:sidebar" />
                    </td>
                    <td class="contents" valign="top">
                        
                        <div class="button">
                            <a href="javascript:void(0);" id="add_links" class="default_button"><span></span>新增友情链接</a>
                            <!--a href="javascript:void(0);" id="add_links_type" class="default_button" style="margin-left: 10px;"><span></span>新增链接分类</a-->
                            <!--a href="{:U('typelist',array('tag'=>$_GET['tag']))}" id="flink_type_list" class="default_button" style="margin-left: 10px;"><span></span>链接分类管理</a-->
                        </div>
                                              
                        <div class="a_table">
                            
                            <table cellspacing="1" width="100%" class="gr_list">
                                <tr style="background: #f0f7ff; font-weight: bold;">
                                    <td width="20" height="20" class="left_text"></td>
                                    <td width="60" align="center" class="left_text">编号</td>
                                    <td align="center" class="left_text">名称</td>
                                    <td align="center" class="left_text">链接</td>
                                    <td align="center" class="left_text">分类</td>
                                    <td align="center" class="left_text">logo</td>
                                    <td width="100" align="center">状态</td>
                                    <td width="160" align="center" class="left_text">操作</td>
                                </tr>
                                <volist id="vo" name="list">
                                <tr rel="{$vo['id']}">
                                    <td><input type="checkbox" name="list[]" value="{$vo.id}" /></td>
                                    <td align="center">{$vo['id']}</td>
                                    <td><a href="{:U('edit',array(
                                        'id' => $vo['id'],
                                        'cid' => $vo['cid'],
                                        'tag' => $_GET['tag'],
                                    ))}" class="edit_links">{$vo['name']}</a></td>
                                    <td align="center">{$vo.url}</td>
                                    <td align="center">{$vo['cid']|getParentCategory}</td>
                                    <td align="center">
                                        <?php
                                            if (!empty($vo['logo'])){
                                        ?>
                                        <img src="{$vo.logo}" />
                                        <?php
                                            }
                                        ?>
                                    </td>
                                    <td align="center">{$vo['status']|getStatus}</td>
                                    <td align="center">
                                        <a href="{:U('edit',array(
                                        'id' => $vo['id'],
                                        'cid' => $vo['cid'],
                                        'tag' => $_GET['tag'],
                                    ))}" class="edit_links">编辑</a><span class="action_line">&nbsp;&nbsp;|&nbsp;&nbsp;</span><a href="{:U('delete',array(
                                        'id' => $vo['id'],
                                        'cid' => $vo['cid'],
                                    ))}" class="del_node" rel="{$vo.id}">删除</a>
                                    </td>
                                </tr>
                                </volist>
                            </table>
                            <div class="page">{$page}</div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        
        <include file="Public:footer" />
    </body>
</html>